<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>

<html xmlns="http://www.w3.org/1999/xhtml">

	<head>

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

		<title><?php echo C('WEB_TITLE');?></title>

		<link rel="stylesheet" type="text/css" href="/Public/css/common.css"/>

		<link rel="stylesheet" type="text/css" href="/Public/js/layui/css/layui.css" media="all"/>

		<link rel="stylesheet" href="/Public/js/datepicker/datepicker.css"/>

		<link rel="stylesheet" type="text/css" href="/Public/crm/css/index.css"/>

		<link rel="stylesheet" type="text/css" href="/Public/crm/css/style.css"/>

		<link rel="stylesheet" href="<?php echo C('PC_ICON_HTTP');?>">

		<script type="text/javascript" >

			const moduleName = "<?php echo (MODULE_NAME); ?>";

		</script>

        <link rel="stylesheet" href="/Public/js/viewer/css/viewer.min.css">
		
		<link rel="stylesheet" type="text/css" href="/Public/js/select2/select2.css" media="all"/>

		<script type="text/javascript" src="/Public/js/jquery-1.9.1.min.js"></script>
		
		<script type="text/javascript" src="/Public/js/jquery-ui.min.js"></script>

		<script type="text/javascript" src="/Public/js/cookie/jquery.cookie.js"></script>

		<script type="text/javascript" src="/Public/js/lang/<?php echo (getStrToLower(cookie('think_language'))); ?>.js"></script>

		<script type="text/javascript" src="/Public/js/colorpicker.js"></script>

		<script type="text/javascript" src="/Public/js/layer/layer.js"></script>

		<script type="text/javascript" src="/Public/js/layui/layui.js"></script>

        <script type="text/javascript" src="/Public/js/feeldesk.js"></script>

        <script type="text/javascript" src="/Public/crm/js/index.js"></script>

        <script type="text/javascript" src="/Public/js/jquery.nicescroll.js"></script>

		<script type="text/javascript" src="/Public/js/clipboard.min.js"></script>

		<script type="text/javascript" src="/Public/js/select2/select2.min.js"></script>

		<script type="text/javascript" src="/Public/js/select2/jquery.core.js"></script>

	</head>

<body>

<script type="text/javascript" src="/Public/js/datepicker/datepicker.all.js"></script>

<script type="text/javascript" src="/Public/js/datepicker/moment.min.js"></script>

<script type="text/javascript" src="/Public/js/datepicker/datepicker.en.js"></script>

    <div class="fd-right-main">

        

    <div class="list-main layui-form">

		<div class="layui-tab">

            <ul class="layui-tab-title">

                <li class="layui-this"><?php if((ACTION_NAME) == "agent"): echo L('DEALER_LIST'); else: echo L('CUSTOMER_LIST'); endif; ?><span class="page-content"><?php echo L('TOTAL_RECORDS');?>：<span><?php echo ((isset($pageCount) && ($pageCount !== ""))?($pageCount):'0'); ?></span> <?php echo L('STRIP');?></span></li>

            </ul>

        </div>

		<!-- 筛选 -->
		<div class="list-filter select-fiter" data-type="customer_auth">

	<div class="list-filter-tit"><?php echo L('VIEW_RANGE');?></div>

	<?php if(!empty($isCreaterView)): if(!empty($isOwnViewAuth)): ?><div class="list-filter-option <?php if(($customer_auth) == "own-charge"): ?>active<?php endif; ?>" data-value="own-charge"><?php echo L('MY_CHARGE');?></div><?php endif; ?>

		<?php if(!empty($isOwnViewAuth)): ?><div class="list-filter-option <?php if(($customer_auth) == "own-create"): ?>active<?php endif; ?>" data-value="own-create"><?php echo L('MY_CREATED');?></div><?php endif; ?>

	<?php else: ?>

		<?php if(!empty($isOwnViewAuth)): ?><div class="list-filter-option <?php if(($customer_auth) == "own"): ?>active<?php endif; ?>" data-value="own"><?php echo L('PERSONAL');?></div><?php endif; endif; ?>

	<?php if(!empty($isGroupViewAuth)): ?><div class="list-filter-option <?php if(($customer_auth) == "group"): ?>active<?php endif; ?>" data-value="group"><?php echo L('GROUP');?></div><?php endif; ?>

	<?php if(!empty($isAllViewAuth)): ?><div class="list-filter-option <?php if(($customer_auth) == "all"): ?>active<?php endif; ?>" data-value="all"><?php echo L('WHOLE');?></div><?php endif; ?>

</div>

		<?php if(is_array($filterlist)): $i = 0; $__LIST__ = $filterlist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><div class="list-filter select-fiter" data-type="highKeyword[define_form][<?php echo ($vo["form_name"]); ?>]">

				<div class="list-filter-tit"><?php echo ($vo["form_description"]); ?></div>

				<?php if(is_array($vo["option"])): $i = 0; $__LIST__ = $vo["option"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><div class="list-filter-checkbox <?php if(in_array($v,explode(',',$highKeyword['define_form'][$vo['form_name']]))): ?>active<?php endif; ?>" data-value="<?php echo ($v); ?>"><span class="iconfont <?php if(in_array($v,explode(',',$highKeyword['define_form'][$vo['form_name']]))): ?>icon-square-selected<?php else: ?>icon-weixuanzhong<?php endif; ?>"></span><?php echo ($v); ?></div><?php endforeach; endif; else: echo "" ;endif; ?>

			</div><?php endforeach; endif; else: echo "" ;endif; ?>

		<div class="list-filter" data-type="highKeyword[time_range_type]">

			<div class="list-filter-tit"><?php echo L('SELECT_TIME');?></div>

			<div class="c-datepicker-date-editor  J-datepicker-range-day wit10 bra3">
	<input placeholder="<?php echo L('STARTING_TIME');?>" name="highKeyword[start_time]" class="begin c-datepicker-data-input only-date" value="<?php echo ($highKeyword["start_time"]); ?>"  readOnly="readOnly" />
	<span class="c-datepicker-range-separator">-</span>
	<input placeholder="<?php echo L('END_TIME');?>" name="highKeyword[end_time]"  class="end c-datepicker-data-input only-date" value="<?php echo ($highKeyword["end_time"]); ?>" readOnly="readOnly" />
</div>

<script type="text/javascript">

	$(function()
	{
		var DATAPICKERAPI = {
			// 默认input显示当前月,自己获取后填充
			activeMonthRange: function () {
				return {
					begin: moment().set({ 'date': 1, 'hour': 0, 'minute': 0, 'second': 0 }).format('YYYY-MM-DD HH:mm:ss'),
					end: moment().set({ 'hour': 23, 'minute': 59, 'second': 59 }).format('YYYY-MM-DD HH:mm:ss')
				}
			},
			shortcutMonth: function () {
				// 当月
				var nowDay = moment().get('date');
				var prevMonthFirstDay = moment().subtract(1, 'months').set({ 'date': 1 });
				var prevMonthDay = moment().diff(prevMonthFirstDay, 'days');
				return {
					now: '-' + nowDay + ',0',
					prev: '-' + prevMonthDay + ',-' + nowDay
				}
			},

			// 快捷选项option
			rangeShortcutOption1: [
				{
					name: "昨天",
					day: '-1,-1',
					time: '00:00:00,23:59:59'
				},
				{
					name: "今天",
					day: '0,0',
					time: '00:00:00,23:59:59'
				},
				{
					name: "最近三天",
					day: '-2,0',
					time: '00:00:00,23:59:59'
				},{
					name: "最近一周",
					day: '-6,0',
					time: '00:00:00,23:59:59'
				}, {
					name: "最近一个月",
					day: '-29,0',
					time: '00:00:00,23:59:59'
				}, {
					name:"最近三个月",
					day: '-89, 0',
					time: '00:00:00,23:59:59'
				}],
		};

		var lang = '<?php echo ($lang); ?>';

		var langTo = 'zh-CN';

		if(lang == 'en-us')
		{
			langTo = 'en';
		}

		if(langTo == 'en')
		{
			DATAPICKERAPI.rangeShortcutOption1 = [
				{
					name: "Yesterday",
					day: '-1,-1',
					time: '00:00:00,23:59:59'
				},
				{
					name: "Today",
					day: '0,0',
					time: '00:00:00,23:59:59'
				},
				{
					name: "Last 3 days",
					day: '-2,0',
					time: '00:00:00,23:59:59'
				},{
					name: "Last 7 days",
					day: '-6,0',
					time: '00:00:00,23:59:59'
				}, {
					name: "Last Month",
					day: '-29,0',
					time: '00:00:00,23:59:59'
				}, {
					name:"Last 3 months",
					day: '-89, 0',
					time: '00:00:00,23:59:59'
				}];
		}

		//年月日范围
		$('.J-datepicker-range-day').datePicker({
			hasShortcut: true,
			format: 'YYYY-MM-DD HH:mm:ss',
			isRange: true,
			language: langTo,
			shortcutOptions: DATAPICKERAPI.rangeShortcutOption1,
			endDate: moment(new Date()), //设置结束器日期
			maxDate: moment(new Date()), //设置最大日期
			hide:function () {
				var starttime = "<?php echo ($highKeyword["start_time"]); ?>";
				var endtime = "<?php echo ($highKeyword["end_time"]); ?>";

				var new_starttime = $("input[name='highKeyword[start_time]']").val();
				var new_endtime = $("input[name='highKeyword[end_time]']").val();

				if(new_starttime != starttime || new_endtime != endtime)
				{
					$("input[name='highKeyword[start_time]']").val(new_starttime);
					$("input[name='highKeyword[end_time]']").val(new_endtime);

					$("input[name='highKeyword[start_time]']").parents('form').submit();
				}
			}
		});
	});

</script>

			<div data-value="create_time" class="filter-time-type layui-form-radio mt0 <?php if(($highKeyword[time_range_type]) == "create_time"): ?>layui-form-radioed<?php endif; if(empty($highKeyword[time_range_type])): ?>layui-form-radioed<?php endif; ?> ml15 fts13 gray6">
				<i class="iconfont <?php if(($highKeyword[time_range_type]) == "create_time"): ?>icon-xuanzhong<?php else: if(empty($highKeyword[time_range_type])): ?>icon-xuanzhong<?php else: ?>icon-xuanze<?php endif; endif; ?> fts15"></i>
				<div><?php echo L('CREATE_TIME');?></div>
			</div>

			<div data-value="next_contact_time" class="filter-time-type <?php if(($highKeyword[time_range_type]) == "next_contact_time"): ?>layui-form-radioed<?php endif; ?> layui-form-radio mt0 fts13 gray6">
				<i class="iconfont <?php if(($highKeyword[time_range_type]) == "next_contact_time"): ?>icon-xuanzhong<?php else: ?>icon-xuanze<?php endif; ?> fts15"></i>
				<div><?php echo L('NEXT_CONTACT');?></div>
			</div>

			<div data-value="last_follow_time" class="filter-time-type <?php if(($highKeyword[time_range_type]) == "last_follow_time"): ?>layui-form-radioed<?php endif; ?> layui-form-radio mt0 fts13 gray6">
				<i class="iconfont <?php if(($highKeyword[time_range_type]) == "last_follow_time"): ?>icon-xuanzhong<?php else: ?>icon-xuanze<?php endif; ?> fts15"></i>
				<div><?php echo L('FINAL_FOLLOW-UP');?></div>
			</div>

		</div>

		<div class="list-filter select-fiter" data-type="sort_by">

	<div class="list-filter-tit"><?php echo L('SORT_BY');?></div>

	<div class="list-filter-option list-filter-sort-by <?php if(in_array(($sort_by), explode(',',"followtime-desc,followtime-asc"))): ?>active<?php endif; ?>" data-value="followtime-desc">
		<?php echo L('SORT_BY_LAST_FOLLOW_UP_TIME');?>
		<?php if(in_array(($sort_by), explode(',',"followtime-desc,followtime-asc"))): if(($sort_by) == "followtime-asc"): ?><i class="iconfont icon-up" data-value="followtime-desc"></i><?php endif; ?>
			<?php if(($sort_by) == "followtime-desc"): ?><i class="iconfont icon-downs" data-value="followtime-asc"></i><?php endif; ?>

			<?php else: ?>
			<i class="iconfont icon-sort-small-copy" data-value="followtime-desc"></i><?php endif; ?>
	</div>

	<div class="list-filter-option list-filter-sort-by <?php if(in_array(($sort_by), explode(',',"contacttime-desc,contacttime-asc"))): ?>active<?php endif; ?>" data-value="contacttime-desc">
		<?php echo L('SORT_BY_NEXT_CONTACT_TIME');?>
		<?php if(in_array(($sort_by), explode(',',"contacttime-desc,contacttime-asc"))): if(($sort_by) == "contacttime-asc"): ?><i class="iconfont icon-up" data-value="contacttime-desc"></i><?php endif; ?>
			<?php if(($sort_by) == "contacttime-desc"): ?><i class="iconfont icon-downs" data-value="contacttime-asc"></i><?php endif; ?>

			<?php else: ?>
			<i class="iconfont icon-sort-small-copy" data-value="contacttime-desc"></i><?php endif; ?>
	</div>

	<div class="list-filter-option list-filter-sort-by <?php if(in_array(($sort_by), explode(',',"createtime-desc,createtime-asc"))): ?>active<?php endif; ?>" data-value="createtime-desc">
		<?php echo L('SORT_BY_CREATION_TIME');?>
		<?php if(in_array(($sort_by), explode(',',"createtime-desc,createtime-asc"))): if(($sort_by) == "createtime-asc"): ?><i class="iconfont icon-up" data-value="createtime-desc"></i><?php endif; ?>
			<?php if(($sort_by) == "createtime-desc"): ?><i class="iconfont icon-downs" data-value="createtime-asc"></i><?php endif; ?>

			<?php else: ?>
			<i class="iconfont icon-sort-small-copy" data-value="createtime-desc"></i><?php endif; ?>

	</div>

</div>

        <div class="list-header clearfix">

            <div class="header-left">

                <?php echo FEELCRM('Customer/create','',L('ADD_CUSTOMER'),'item-deleteBtn','','iconfont icon-adduser');?>

            </div>

            <div class="header-right">

				<div class="customer-listOperate">

					<div class="listOperate">

						<div class="layui-form">

							<select class="layui-input" disabled><option><?php echo L('OPERATION');?></option></select>

						</div>

						<div class="operate hidden">

							<?php if(!empty($istoPoolCustomerAuth)): ?><a href="javascript:"  data-href="<?php echo U('Customer/toPool');?>" data-name="<?php echo L('GIVE_UP_CUSTOMERS');?>" id="toPoolCustomer"><?php echo L('GIVE_UP_CUSTOMERS');?></a><?php endif; ?>

							<?php if(!empty($istransferCustomerAuth)): ?><a href="javascript:" class="chooseMemberDetail" data-id="" data-href="<?php echo U('Customer/transfer');?>" data-name="<?php echo L('TRANSFER');?>" id="transferCustomer"><?php echo L('CUSTOMER_TRANSFER');?></a><?php endif; ?>

							<?php if(($isTicketAuth) == "10"): if(!empty($iscreateFeeldeskAuth)): ?><a href="javascript:"  data-href="<?php echo U('Customer/createFeeldesk');?>" title="<?php echo L('USE_LOGIN_TICKET');?>" data-name="<?php echo L('ADD_TO_MEMBER');?>" id="createFeeldesk"><?php echo L('ADD_TO_MEMBER');?></a><?php endif; endif; ?>

							<?php if(!empty($isDelCustomerAuth)): ?><a href="javascript:"  data-href="<?php echo U('Customer/delete');?>" data-name="<?php echo L('DELETE');?>" id="delCustomer"><?php echo L('DELETE_CUSTOMER');?></a><?php endif; ?>

							<?php if(!empty($isExportCustomerAuth)): ?><a href="javascript:" title="<?php echo L('EXPORT');?>" id="startExport"><?php echo L('EXPORT_DATA');?></a><?php endif; ?>

							<?php if(!empty($isImportCustomerAuth)): ?><a href="javascript:" id="uploadFile"><?php echo L('IMPORT_CUSTOMER');?></a>

								<a href="/<?php echo ($importTemp); ?>" title="<?php echo L('CUSTOMER_IMPORT_TEMPLATE');?>" download="<?php echo L('CUSTOMER_IMPORT_TEMPLATE');?>" ><?php echo L('DOWNLOAD_TEMPLATE');?></a><?php endif; ?>

						</div>

					</div>

				</div>

				<span class="advanced-searc-btn fr" id="advanced-search-btn"><i class="iconfont icon-shaixuan"></i> <span><?php echo L('ADVANCED_SEARCH');?></span></span>

                <form action="<?php echo ($controllerAndAction); ?>" method="get" class="fr" id="filterForm">

					<input type="hidden" name='customer_auth' value="<?php echo ($customer_auth); ?>" />

					<input type="hidden" name='sort_by' value="<?php echo ($sort_by); ?>" />

					<input type="hidden" name='highKeyword[condition]' value="1" />

					<input type="hidden" name='highKeyword[define_form][importance]' value="<?php echo ($highKeyword["define_form"]["importance"]); ?>" />

					<input type="hidden" name='highKeyword[define_form][customer_grade]' value="<?php echo ($highKeyword["define_form"]["customer_grade"]); ?>" />

					<input type="hidden" name="highKeyword[start_time]"  value="<?php echo ($highKeyword["start_time"]); ?>" />

					<input type="hidden" name="highKeyword[end_time]"  value="<?php echo ($highKeyword["end_time"]); ?>" />

					<input type="hidden" name="highKeyword[time_range_type]" value="<?php echo ($highKeyword["time_range_type"]); ?>" />

					<!--<div class="c-datepicker-date-editor  J-datepicker-range-day wit10 bra3">
	<input placeholder="<?php echo L('STARTING_TIME');?>" name="highKeyword[start_time]" class="begin c-datepicker-data-input only-date" value="<?php echo ($highKeyword["start_time"]); ?>"  readOnly="readOnly" />
	<span class="c-datepicker-range-separator">-</span>
	<input placeholder="<?php echo L('END_TIME');?>" name="highKeyword[end_time]"  class="end c-datepicker-data-input only-date" value="<?php echo ($highKeyword["end_time"]); ?>" readOnly="readOnly" />
</div>

<script type="text/javascript">

	$(function()
	{
		var DATAPICKERAPI = {
			// 默认input显示当前月,自己获取后填充
			activeMonthRange: function () {
				return {
					begin: moment().set({ 'date': 1, 'hour': 0, 'minute': 0, 'second': 0 }).format('YYYY-MM-DD HH:mm:ss'),
					end: moment().set({ 'hour': 23, 'minute': 59, 'second': 59 }).format('YYYY-MM-DD HH:mm:ss')
				}
			},
			shortcutMonth: function () {
				// 当月
				var nowDay = moment().get('date');
				var prevMonthFirstDay = moment().subtract(1, 'months').set({ 'date': 1 });
				var prevMonthDay = moment().diff(prevMonthFirstDay, 'days');
				return {
					now: '-' + nowDay + ',0',
					prev: '-' + prevMonthDay + ',-' + nowDay
				}
			},

			// 快捷选项option
			rangeShortcutOption1: [
				{
					name: "昨天",
					day: '-1,-1',
					time: '00:00:00,23:59:59'
				},
				{
					name: "今天",
					day: '0,0',
					time: '00:00:00,23:59:59'
				},
				{
					name: "最近三天",
					day: '-2,0',
					time: '00:00:00,23:59:59'
				},{
					name: "最近一周",
					day: '-6,0',
					time: '00:00:00,23:59:59'
				}, {
					name: "最近一个月",
					day: '-29,0',
					time: '00:00:00,23:59:59'
				}, {
					name:"最近三个月",
					day: '-89, 0',
					time: '00:00:00,23:59:59'
				}],
		};

		var lang = '<?php echo ($lang); ?>';

		var langTo = 'zh-CN';

		if(lang == 'en-us')
		{
			langTo = 'en';
		}

		if(langTo == 'en')
		{
			DATAPICKERAPI.rangeShortcutOption1 = [
				{
					name: "Yesterday",
					day: '-1,-1',
					time: '00:00:00,23:59:59'
				},
				{
					name: "Today",
					day: '0,0',
					time: '00:00:00,23:59:59'
				},
				{
					name: "Last 3 days",
					day: '-2,0',
					time: '00:00:00,23:59:59'
				},{
					name: "Last 7 days",
					day: '-6,0',
					time: '00:00:00,23:59:59'
				}, {
					name: "Last Month",
					day: '-29,0',
					time: '00:00:00,23:59:59'
				}, {
					name:"Last 3 months",
					day: '-89, 0',
					time: '00:00:00,23:59:59'
				}];
		}

		//年月日范围
		$('.J-datepicker-range-day').datePicker({
			hasShortcut: true,
			format: 'YYYY-MM-DD HH:mm:ss',
			isRange: true,
			language: langTo,
			shortcutOptions: DATAPICKERAPI.rangeShortcutOption1,
			endDate: moment(new Date()), //设置结束器日期
			maxDate: moment(new Date()), //设置最大日期
			hide:function () {
				var starttime = "<?php echo ($highKeyword["start_time"]); ?>";
				var endtime = "<?php echo ($highKeyword["end_time"]); ?>";

				var new_starttime = $("input[name='highKeyword[start_time]']").val();
				var new_endtime = $("input[name='highKeyword[end_time]']").val();

				if(new_starttime != starttime || new_endtime != endtime)
				{
					$("input[name='highKeyword[start_time]']").val(new_starttime);
					$("input[name='highKeyword[end_time]']").val(new_endtime);

					$("input[name='highKeyword[start_time]']").parents('form').submit();
				}
			}
		});
	});

</script>-->

					<div class="compact-menu">

						<!--<?php if(!empty($isExportCustomerAuth)): ?><a href="javascript:" title="<?php echo L('EXPORT');?>" id="startExport"><i class="iconfont icon-download"></i></a><?php endif; ?>

						<a href="javascript:" title="<?php echo L('ADVANCED_SEARCH');?>" id="advanced-search-btn"><i class="iconfont icon-shaixuan"></i></a>-->

					</div>

                    <div class="compact-search">

                        <i class="iconfont icon-search crmSearchBtn"></i>

                        <input type="text" name="keyword" value="<?php echo ($keyword); ?>" placeholder="<?php echo L('CLIENT_NAME');?>/<?php echo L('CONTACT');?>/<?php echo L('PHONE');?>/<?php echo L('MAILBOX');?>/<?php echo L('WECHAT_NUMBER');?>" onkeydown="javascript:if (event.keyCode == 13){$(this).parents('form').submit();}" />

                        <!--<a href="javascript:" class="searchBtn"><?php echo L('SEARCH');?></a>-->

                    </div>

                </form>

            </div>

        </div>

		<div id="advanced-search" class="hidden feelcrm-advanced-search feeldesk-form hg100">

			<form action="<?php echo ($controllerAndAction); ?>" method="get" id="highSearchForm" class="hg100">

				<input type="hidden" name='customer_auth' value="<?php echo ($customer_auth); ?>" />

				<input type="hidden" name='sort_by' value="<?php echo ($sort_by); ?>" />

				<?php if(!empty($source_type)): ?><input type="hidden" name="source_type" value="<?php echo ($source_type); ?>">

					<?php if(!empty($encryData)): ?><input type="hidden" name="apiData" value="<?php echo ($encryData); ?>"><?php endif; endif; ?>

			<div class="feeldesk-form pd0 feelcrm-form">

				<div class="layui-tab">

					<ul class="layui-tab-title">

						<li class="tab-title-name"><?php echo L('ADVANCED_SEARCH');?></li>

						<li class="tab-title-btn">

							<a href="javascript:highSearch();" class="layui-btn layui-btn-normal titleSubmit"><?php echo l('SEARCH');?></a>

							<a href="javascript:closeLayerAll();" class="layui-btn layui-btn-normal titleCancel"><?php echo l('CANCEL');?></a>

							<div class="clear"></div>

						</li>

					</ul>

				</div>

			</div>


			<div class="form-content">

                <div class="form-item pb25 pt50 create-both-end">

					<input type="hidden" name="highKeyword[start_time]" value="<?php echo ($highKeyword["start_time"]); ?>" >

					<input type="hidden" name="highKeyword[end_time]" value="<?php echo ($highKeyword["end_time"]); ?>" >

					<input type="hidden" name="highKeyword[time_range_type]" value="<?php echo ($highKeyword["time_range_type"]); ?>" >

					<div class="layui-form-item">

						<label class="layui-form-label">

							<?php echo L('MEET_CONDITIONS');?>

						</label>

						<div class="layui-input-inline">

							<input type="radio" name="highKeyword[condition]" value="1" <?php if(($highKeyword["condition"]) == "1"): ?>checked<?php endif; ?> <?php if(empty($highKeyword["condition"])): ?>checked<?php endif; ?> title="<?php echo L('ALL_SATISFIED');?>">

							<input type="radio" name="highKeyword[condition]" value="2" <?php if(($highKeyword["condition"]) == "2"): ?>checked<?php endif; ?> title="<?php echo L('PARTIALLY_SATISFIED');?>">

						</div>

						<i class="layui-icon layui-icon-about intro-icon" data-note="<?php echo L('HIGH_FILTER_REMARK');?>"></i>

					</div>

					<?php if(ACTION_NAME != 'product' && CONTROLLER_NAME != 'Product'): if(($customer_auth) != "own"): ?><div class="layui-form-item">

								<label class="layui-form-label mt5"><?php echo L('SELECT_SECTOR');?></label>

								<div class="layui-input-inline" id="highKeywordGroupId"></div>

							</div><?php endif; ?>

					<div class="layui-form-item">

						<?php if(in_array(CONTROLLER_NAME.'/'.ACTION_NAME,['Clue/pool','Customer/pool','Customer/followup','Recover/follow'])): ?><label class="layui-form-label mt5"><?php echo L('FOUNDER');?></label>

						<?php else: ?>

							<label class="layui-form-label mt5"><?php echo L('LEADER');?></label><?php endif; ?>

						<div class="layui-input-inline" id="highKeywordMemberId"></div>

					</div>

					<?php if(!in_array(CONTROLLER_NAME.'/'.ACTION_NAME,['Clue/pool','Customer/pool','Customer/followup','Recover/follow']) && $isCreaterView): ?><div class="layui-form-item">

							<label class="layui-form-label mt5"><?php echo L('FOUNDER');?></label>

							<div class="layui-input-inline" id="highKeywordCreateId"></div>

						</div><?php endif; ?>

					<script type="text/javascript">

						var highKeywordGroups = <?php echo ($highKeywordGroups); ?>;

						var highKeywordMembers = <?php echo ($highKeywordMembers); ?>;

						var highKeywordCurrMembers = '<?php echo ($highKeywordCurrMembers); ?>';

						if(!highKeywordCurrMembers)
						{
							highKeywordCurrMembers = highKeywordMembers;
						}
						else
						{
							highKeywordCurrMembers = JSON.parse(highKeywordCurrMembers);
						}

						var highKeywordGroupId = '<?php echo ($highKeywordGroupId); ?>';

						var highKeywordMemberId = '<?php echo ($highKeywordMemberId); ?>';

						var highKeywordCreateId = '<?php echo ($highKeywordCreateId); ?>';

						var is_loaded = 1;

						layui.config({
							base : '/Public/js/layui/extends/'
						}).use(['selectM'],function()
						{
							var list = layui.selectM(
							{
								elem: '#highKeywordMemberId',
								tips: '<?php echo L("PLEASE_SELECT");?>',
								data: highKeywordCurrMembers,
								selected: highKeywordMemberId.split(','),
								width:'60%',
								max:100,
							});

							if($("#highKeywordCreateId").size()>0)
							{
								var list2 = layui.selectM(
								{
									elem: '#highKeywordCreateId',
									tips: '<?php echo L("PLEASE_SELECT");?>',
									data: highKeywordCurrMembers,
									selected: highKeywordCreateId.split(','),
									width:'60%',
									max:100,
								});
							}

							layui.selectM(
							{
								elem: '#highKeywordGroupId',
								data: highKeywordGroups,
								selected: highKeywordGroupId.split(','),
								tips: '<?php echo L("PLEASE_SELECT");?>',
								width:'60%',
								max:100,
								callback:function (values)
								{
									var groups = values;

									if(groups && is_loaded != 1)
									{
										if(groups.length == 0)
										{
											list.config.data = highKeywordMembers;
											list.render();
											list.render();

											if($("#highKeywordCreateId").size()>0)
											{
												list2.config.data = highKeywordMembers;
												list2.render();
												list2.render();
											}
										}
										else
										{
											$.ajax({
												url:"<?php echo U('AjaxRequest/getMemberByGroups');?>",
												type:'POST',
												async: false,
												data:{'groups':groups},
												datatype:'json',
												success:function(data)
												{
													if(data)
													{
														list.config.data = data.data;
														list.render();
														list.render();

														if($("#highKeywordCreateId").size()>0)
														{
															list2.config.data = data.data;
															list2.render();
															list2.render();
														}
													}
												}
											});
										}
									}
									is_loaded = 0;
								}
							});
						})

					</script><?php endif; ?>

					<!--<div class="layui-form-item">

						<label class="layui-form-label">

						   <?php echo L('CUSTOMER_RESPONSIBLE');?>

						</label>

						<div class="layui-input-inline">

							<select name="highKeyword[member_id]" lay-ignore id="kwMemberId">

								<option value=""><?php echo L('CHOOSE'); echo L('CUSTOMER_RESPONSIBLE');?></option>

								<?php if(is_array($members)): $i = 0; $__LIST__ = $members;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><option value="<?php echo ($v["member_id"]); ?>" <?php if(($highKeyword["member_id"]) == $v["member_id"]): ?>selected<?php endif; ?>><?php echo ($v["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>

							</select>

							<script>

								$("#kwMemberId").select2();

							</script>

						</div>

						<i class="layui-icon layui-icon-about intro-icon" data-note="<?php echo L('ENTER_NAME_SEARCH');?>"></i>

					</div>-->

					<div class="layui-form-item">

						<label class="layui-form-label">

						   <?php echo L('CUSTOMER_NUMBER');?>

						</label>

						<div class="layui-input-inline">

							 <input type="text" name="highKeyword[customer_no]" value="<?php echo ($highKeyword["customer_no"]); ?>" placeholder="" class="layui-input">

						</div>

						<i class="layui-icon layui-icon-about intro-icon" data-note="<?php echo L('SEARCH_FUZZY_QUERY');?>"></i>

					</div>

					<div class="layui-form-item">

						<label class="layui-form-label">

						   <?php echo L('TRANSACTION_STATUS');?>

						</label>

						<div class="layui-input-inline">

							<input type="radio" name="highKeyword[is_trade]" value="0" <?php if(($highKeyword["is_trade"]) == "0"): ?>checked<?php endif; ?> title="<?php echo L('UNSOLD');?>">

							<input type="radio" name="highKeyword[is_trade]" value="1" <?php if(($highKeyword["is_trade"]) == "1"): ?>checked<?php endif; ?> title="<?php echo L('DEAL_DONE');?>">

						</div>

					</div>

					<?php $t = 0; $ft = 0; $reg = 0; ?>

<?php if(is_array($defineformlist)): $i = 0; $__LIST__ = $defineformlist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><div class="layui-form-item">

		<label class="layui-form-label">

		   <?php echo ($vo["form_description"]); ?>

		</label>

		<?php if(($vo["form_type"]) == "region"): $reg++; ?>

			<div class="region-input-div fl wd60">

			<div class="layui-input-inline wd100 mb10 layui-form region-item" lay-filter="country">

				<select class="regionCountry" name="highKeyword[define_form][<?php echo ($vo["form_name"]); ?>][defaultCountry]" lay-filter="select-country<?php echo $reg; ?>" id="country<?php echo $reg; ?>" lay-ignore >

					<option value=""><?php echo L('PLEASE_SELECT');?></option>

					<?php if(is_array($country)): $i = 0; $__LIST__ = $country;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vc): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vc["code"]); ?>"><?php echo ($vc["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>

				</select>

			</div>

			<div class="layui-input-inline wd100 mb10 hidden layui-form region-item" lay-filter="province">

				<select class="regionProv" name="highKeyword[define_form][<?php echo ($vo["form_name"]); ?>][defaultProv]" lay-filter="select-province<?php echo $reg; ?>" id="province<?php echo $reg; ?>" lay-ignore>

					<option value=""><?php echo L('PLEASE_SELECT');?></option>

				</select>

			</div>

			<div class="layui-input-inline wd100 mb10 hidden layui-form region-item" lay-filter="city">

				<select class="regionCity" name="highKeyword[define_form][<?php echo ($vo["form_name"]); ?>][defaultCity]" lay-filter="select-city<?php echo $reg; ?>" id="city<?php echo $reg; ?>" lay-ignore>

					<option value=""><?php echo L('PLEASE_SELECT');?></option>

				</select>

			</div>

			<div class="layui-input-inline wd100 mb10 hidden layui-form region-item" lay-filter="area">

				<select name="highKeyword[define_form][<?php echo ($vo["form_name"]); ?>][defaultArea]" lay-filter="select-area<?php echo $reg; ?>" id="area<?php echo $reg; ?>" lay-ignore >

					<option value=""><?php echo L('PLEASE_SELECT');?></option>

				</select>

			</div>

			</div>

			<i class="layui-icon layui-icon-about intro-icon fl blue8 ml10" data-note="<?php echo L('ENTER_NAME_SEARCH');?>"></i>

			<script type="text/javascript">

				$("#country<?php echo $reg; ?>").select2();

				$("#province<?php echo $reg; ?>").select2();

				$("#city<?php echo $reg; ?>").select2();

				$("#area<?php echo $reg; ?>").select2();

				$("#country<?php echo $reg; ?>").change(function()
				{
					selectProvince('<?php echo $reg; ?>',"<?php echo U('AjaxRequest/getRegion');?>");
				})

				$("#province<?php echo $reg; ?>").change(function()
				{
					selectCity('<?php echo $reg; ?>',"<?php echo U('AjaxRequest/getRegion');?>");
				})

				$("#city<?php echo $reg; ?>").change(function()
				{
					selectArea('<?php echo $reg; ?>',"<?php echo U('AjaxRequest/getRegion');?>");
				})

			</script>

		<?php else: ?>

			<div class="layui-input-inline">

				 <?php if(($vo["form_type"]) == "text"): ?><!-- 单行文本框 -->
					<input type="text" name="highKeyword[define_form][<?php echo ($vo["form_name"]); ?>]" value="<?php echo ($highKeyword['define_form'][$vo['form_name']]); ?>" placeholder="" class="layui-input"><?php endif; ?>

				 <?php if(($vo["form_type"]) == "phone"): ?><!-- <?php echo L('CELL_PHONE');?> -->
					<input type="text" onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && event.keyCode<48 || event.keyCode>57) event.returnValue=false" name="highKeyword[define_form][<?php echo ($vo["form_name"]); ?>]" value="<?php echo ($highKeyword['define_form'][$vo['form_name']]); ?>" placeholder="" class="layui-input"><?php endif; ?>

				 <?php if(($vo["form_type"]) == "email"): ?><!-- <?php echo L('MAILBOX');?> -->
					<input type="text" name="highKeyword[define_form][<?php echo ($vo["form_name"]); ?>]" value="<?php echo ($highKeyword['define_form'][$vo['form_name']]); ?>" placeholder="" class="layui-input"><?php endif; ?>

				 <?php if(($vo["form_type"]) == "number"): ?><!-- <?php echo L('DIGITAL');?> -->
					<input type="number" onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && event.keyCode<48 || event.keyCode>57) event.returnValue=false" name="highKeyword[define_form][<?php echo ($vo["form_name"]); ?>]" value="<?php echo ($highKeyword['define_form'][$vo['form_name']]); ?>" placeholder="" class="layui-input"><?php endif; ?>

				<?php if(($vo["form_type"]) == "decimal"): ?><!-- 小数 -->
					<input type="text" name="highKeyword[define_form][<?php echo ($vo["form_name"]); ?>]" value="<?php echo ($highKeyword['define_form'][$vo['form_name']]); ?>" placeholder="" class="layui-input"><?php endif; ?>

				<?php if(($vo["form_type"]) == "select"): ?><!-- 下拉菜单 -->
					<select name="highKeyword[define_form][<?php echo ($vo["form_name"]); ?>]">

						<option value=""><?php echo ($vo["form_description"]); ?></option>

						<?php if(is_array($vo["option"])): foreach($vo["option"] as $key=>$op): ?><option value="<?php echo ($op); ?>" <?php if(($highKeyword['define_form'][$vo['form_name']]) == $op): ?>selected<?php endif; ?>><?php echo ($op); ?></option><?php endforeach; endif; ?>

					</select><?php endif; ?>
				
				<?php if(($vo["form_type"]) == "select_text"): $st++; ?>
					<!-- 下拉填写 -->
					<input type="text" name="highKeyword[define_form][<?php echo ($vo["form_name"]); ?>]" placeholder="" value="<?php echo ($highKeyword['define_form'][$vo['form_name']]); ?>" readonly="readonly" class="layui-input cursor">

					<ul id="selectText<?php echo ($st); ?>" class="select-text">

						<?php if(is_array($vo["option"])): foreach($vo["option"] as $key=>$op): ?><li data-value="<?php echo ($op); ?>" <?php if(($highKeyword['define_form'][$vo['form_name']]) == $op): ?>class="active"<?php endif; ?>><?php echo ($op); ?></li><?php endforeach; endif; ?>

					</ul>

					<script>

						$('input[name="highKeyword[define_form][<?php echo ($vo["form_name"]); ?>]').click(function ()
						{
							if($('#selectText<?php echo ($st); ?>').is(':hidden'))
							{
								$('#selectText<?php echo ($st); ?>').slideDown(100);
							}
							else
							{
								$('#selectText<?php echo ($st); ?>').slideUp(100);
							}

							$('#selectText<?php echo ($st); ?> li').click(function ()
							{
								$('#selectText<?php echo ($st); ?> li').removeClass('active');
								var value = $(this).data('value');
								if(value == '其他')
								{
									$('input[name="highKeyword[define_form][<?php echo ($vo["form_name"]); ?>]').removeAttr("readonly");
									$('input[name="highKeyword[define_form][<?php echo ($vo["form_name"]); ?>]').val('');
									$('input[name="highKeyword[define_form][<?php echo ($vo["form_name"]); ?>]').focus();
								}
								else
								{
									$('input[name="highKeyword[define_form][<?php echo ($vo["form_name"]); ?>]').attr('readonly','readonly');
									$('input[name="highKeyword[define_form][<?php echo ($vo["form_name"]); ?>]').val(value);
								}
								$(this).addClass('active');
								$('#selectText<?php echo ($st); ?>').hide();
							})
						})

					</script><?php endif; ?>

				<!-- 时间控件 -->
				<?php if(($vo["form_type"]) == "date"): $ft++; ?>

					<input type='text' name="highKeyword[define_form][<?php echo ($vo["form_name"]); ?>]" value="<?php echo ($highKeyword['define_form'][$vo['form_name']]); ?>" class="layui-input cursor layui-form-time" id="form_time<?php echo $ft; ?>" placeholder="<?php echo L('SELECT_TIME');?>" ><?php endif; ?>

				<?php if(($vo["form_type"]) == "checkbox"): ?><!-- 复选框 -->
					<?php if(is_array($vo["option"])): $i = 0; $__LIST__ = $vo["option"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$op): $mod = ($i % 2 );++$i;?><input type="checkbox" name="highKeyword[define_form][<?php echo ($vo["form_name"]); ?>][]" <?php if(in_array(($op), is_array($highKeyword['define_form'][$vo['form_name']])?$highKeyword['define_form'][$vo['form_name']]:explode(',',$highKeyword['define_form'][$vo['form_name']]))): ?>checked<?php endif; ?> lay-skin="primary" title="<?php echo ($op); ?>" value="<?php echo ($op); ?>"><?php endforeach; endif; else: echo "" ;endif; endif; ?>

				<?php if(($vo["form_type"]) == "radio"): ?><!-- 单选框-->
					<?php if(is_array($vo["option"])): $i = 0; $__LIST__ = $vo["option"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$op): $mod = ($i % 2 );++$i;?><input type="radio" name="highKeyword[define_form][<?php echo ($vo["form_name"]); ?>]" <?php if(($highKeyword['define_form'][$vo['form_name']]) == $op): ?>checked<?php endif; ?> value="<?php echo ($op); ?>" title="<?php echo ($op); ?>"><?php endforeach; endif; else: echo "" ;endif; endif; ?>

				<!-- <input type="text" name="highKeyword[define_form][<?php echo ($vo["form_name"]); ?>]" value="<?php echo ($highKeyword['define_form'][$vo['form_name']]); ?>" placeholder="" class="layui-input">-->

			</div>

			<i class="layui-icon layui-icon-about intro-icon" data-note="<?php echo L('ENTER_OR_SELECT_QUERY');?>"></i><?php endif; ?>

	</div><?php endforeach; endif; else: echo "" ;endif; ?>


					<div class="layui-form-item">

						<label class="layui-form-label">

						   <?php echo L('CONTACT_NAME');?>

						</label>

						<div class="layui-input-inline">

							 <input type="text" name="highKeyword[contacter_name]" value="<?php echo ($highKeyword["contacter_name"]); ?>" placeholder="" class="layui-input">

						</div>

						<i class="layui-icon layui-icon-about intro-icon" data-note="<?php echo L('SEARCH_FUZZY_QUERY1');?>"></i>

					</div>

					<div class="layui-form-item">

						<label class="layui-form-label">

						   <?php echo L('CONTACT_NUMBER');?>

						</label>

						<div class="layui-input-inline">

							 <input type="text" name="highKeyword[contacter_phone]" value="<?php echo ($highKeyword["contacter_phone"]); ?>" placeholder="" class="layui-input">

						</div>

						<i class="layui-icon layui-icon-about intro-icon" data-note="<?php echo L('SEARCH_FUZZY_QUERY1');?>"></i>

					</div>

					<div class="layui-form-item">

						<label class="layui-form-label">

						   <?php echo L('CONTACT_EMAIL');?>

						</label>

						<div class="layui-input-inline">

							 <input type="text" name="highKeyword[contacter_email]" value="<?php echo ($highKeyword["contacter_email"]); ?>" placeholder="" class="layui-input">

						</div>

						<i class="layui-icon layui-icon-about intro-icon" data-note="<?php echo L('SEARCH_FUZZY_QUERY1');?>"></i>

					</div>

				</div>

			</div>

			</form>

		</div>

        <div id='list' class="item-list feelcrm-list" >

            <table class="layui-table" lay-skin="line">

                <thead>

                    <tr>

						<th class="checkbox"><input type="checkbox" name="" lay-skin="primary" lay-filter="ListAllChoose"></th>

						<!--<th><?php echo L('CUSTOMER_NUMBER');?></th>

                        <th><?php echo L('INFORMATION_COMPLETENESS');?></th>-->

						<?php if(is_array($formList)): $i = 0; $__LIST__ = $formList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><!-- 字段未设置查看范围或当前用户角色在查看范围内 -->
							<?php if(!$vo['role_id'] || in_array($index['role_id'],explode(',',$vo['role_id']))): ?><th><?php echo ($vo["form_description"]); ?></th>

							<?php if(($vo["form_name"]) == "name"): ?><th><?php echo L('INFORMATION_COMPLETENESS');?></th><?php endif; endif; endforeach; endif; else: echo "" ;endif; ?>

						<!--<th><?php echo L('CUSTOMER_CONTACT');?></th>

						<th><?php echo L('TEL');?></th>-->

						<th><?php echo L('FINAL_FOLLOW-UP');?></th>

						<th><?php echo L('NEXT_CONTACT');?></th>

						<!--<th><?php echo L('IS_LOSE_ORDER');?></th>-->

						<th><?php echo L('CREATE_TIME');?></th>

						<th><?php echo L('LEADER');?></th>

						<th><?php echo L('FOUNDER');?></th>

						<th><?php echo L('ENTRY_METHOD');?></th>

                    </tr>

                </thead>

                <tbody>

                    <?php if(empty($customer)): ?><tr class="nodata center">

                            <td colspan="11">

                                <p><i class="iconfont icon-nothing fts20"></i></p>

                                <p><?php echo L('NO_DATA');?></p>

                            </td>

                        </tr>

                    <?php else: ?>

                        <?php if(is_array($customer)): $i = 0; $__LIST__ = $customer;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr data-id="<?php echo (encrypt($vo["customer_id"],'CUSTOMER')); ?>" data-no="<?php echo ($vo["customer_prefix"]); echo ($vo["customer_no"]); ?>">

								<td class="checkbox relative">

									<input type="checkbox" name="del[]" lay-skin="primary" value="<?php echo (encrypt($vo["customer_id"],'CUSTOMER')); ?>" >

								</td>

								<!--<td mini='customer'><?php echo ($vo["customer_prefix"]); echo ($vo["customer_no"]); ?></td>

                                 <td mini='customer'><?php echo ($vo["percent"]); ?></td>-->

								<?php if(is_array($formList)): $i = 0; $__LIST__ = $formList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><!-- 字段未设置查看范围或当前用户角色在查看范围内 -->
									<?php if(!$v['role_id'] || in_array($index['role_id'],explode(',',$v['role_id']))): ?><td mini='customer' <?php if(($v["form_type"]) == "textarea"): ?>title="<?php echo (strip_tags($vo['detail'][$v['form_name']])); ?>"<?php endif; ?> <?php if(($v["form_name"]) == "name"): ?>class="blue8"<?php endif; ?> >

										<?php if(($v["form_type"]) == "textarea"): echo mb_substr(strip_tags($vo['detail'][$v['form_name']]),0,20);?>...
										<?php else: ?>

											<?php echo ((isset($vo['detail'][$v['form_name']]) && ($vo['detail'][$v['form_name']] !== ""))?($vo['detail'][$v['form_name']]):'--'); ?>

											<?php if(($v["form_name"]) == "phone"): if(!empty($vo['detail'][$v['form_name']])): ?><span class="icon-onclickcall"><i class="iconfont icon-boda blue8" onclick="CallUp(<?php echo ($vo['detail'][$v['form_name']]); ?>,3);"></i></span><?php endif; endif; endif; ?>

									</td>

									<?php if(($v["form_name"]) == "name"): ?><td mini='customer'><?php echo ($vo["percent"]); ?></td><?php endif; endif; endforeach; endif; else: echo "" ;endif; ?>

                                <!--<td mini='customer'><?php echo ($vo["contacter_name"]); ?></td>

                                <td mini='customer'><?php echo ($vo["contacter_phone"]); ?></td>-->

                                <td mini='customer'><?php echo (getDates($vo["lastfollowtime"])); ?></td>

                                <td mini='customer'><?php echo (getDates($vo["nextcontacttime"])); ?></td>

								<td mini='customer'><?php echo (getDates($vo["createtime"])); ?></td>

                                <!--<td mini='customer'><?php if(($vo["is_losed"]) == "1"): ?><span class="red1"><?php echo L('YES');?></span><?php else: ?><span class="blue1"><?php echo L('NO');?></span><?php endif; ?></td>-->

                                <td mini='customer'><?php echo ($vo["member_name"]); ?></td>

                                <td mini='customer'><?php echo getCustomerCreateName($vo['creater_id'],$vo['create_name']);?></td>

                                <td mini='customer'><?php echo getCrmEntryMethod($vo['entry_method']);?></td>

                                <!--<td class="listOperate hidden">

                                    <i class="iconfont icon-dian"></i>

                                    <div class="operate hidden">

                                        <?php echo FEELCRM('Customer/edit',['id'=>encrypt($vo['customer_id'],'CUSTOMER'),'type'=>encrypt('index','CUSTOMER')],L('EDITOR'));?>

                                        <?php echo FEELCRM('Customer/delete',['id'=>encrypt($vo['customer_id'],'CUSTOMER'),'type'=>encrypt('index','CUSTOMER')],L('DELETE'),'','async');?>

                                    </div>

                                </td>-->

                            </tr><?php endforeach; endif; else: echo "" ;endif; endif; ?>

                </tbody>

            </table>

            <div class="right-list-page clearfix"><div class="feeldesk-page"><?php echo ($page); ?></div></div>

        </div>

		<?php if(!empty($istransferCustomerAuth)): ?><div class="hidden hg100 layui-form" id="Memberlist">

	<div class="feeldesk-form pd0 feelcrm-form">

		<div class="layui-tab">

			<ul class="layui-tab-title">

				<li class="tab-title-name"><?php echo L('USER_LIST');?></li>

				<li class="tab-title-btn">

					<a href="javascript:void(0);" id="memberDetailLay" class="layui-btn layui-btn-normal titleSubmit"><?php echo l('SUBMIT');?></a>

					<a href="javascript:closeLayerAll();" class="layui-btn layui-btn-normal titleCancel"><?php echo l('CANCEL');?></a>

					<div class="clear"></div>

				</li>

				<form1 action="" class="fr selectMemberForm" method="get">

					<div class="compact-search">

						<i class="iconfont icon-search"></i>

						<input type="text" name="selectMemberKeyword" value="" placeholder="<?php echo L('NAME1');?>/<?php echo L('CELL_PHONE');?>"/>

						<a href="javascript:" class="selectMemberBtn"><?php echo L('SEARCH');?></a>

					</div>

				</form1>

			</ul>

		</div>

	</div>

	<div class="feelcrm-list">

		<table class="layui-table" lay-skin="line">

			<thead>

				<tr>

					<th></th><th><?php echo L('NAME');?></th><th><?php echo L('EMAIL');?></th><th><?php echo L('MOBILE');?></th><th><?php echo L('SUBORDINATE_SECTOR');?></th><th><?php echo L('ROLE');?></th>

				</tr>

			</thead>

			<tbody id="member-detail">

				<?php if(empty($member)): ?><tr class="nodata center">

						<td colspan="11">

							<p><i class="iconfont icon-nothing fts20"></i></p>

							<p><?php echo L('NO_DATA');?></p>

						</td>

					</tr>

				<?php else: ?>

					<?php if(is_array($member)): $i = 0; $__LIST__ = $member;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>

							<td><input type="radio" value="<?php echo encrypt($vo['member_id'],'MEMBER');?>" name="member" lay-skin="primary" /></td>

							<td><?php echo ($vo["name"]); ?></td>

							<td><?php echo ($vo["email"]); ?></td>

							<td><?php echo ($vo["mobile"]); ?></td>

							<td><?php echo CrmgetMemberGroupName($groupList,$vo['group_id']);?></td>

							<td><?php echo ($roleList[$vo['role_id']]['role_name']); ?></td>

						</tr><?php endforeach; endif; else: echo "" ;endif; endif; ?>

			</tbody>

		</table>

		<div class="right-list-page clearfix"><div class="feeldesk-page"><?php echo ($memberPage); ?></div></div>

	</div>

</div>

<script>

	$('input[name="selectMemberKeyword"]').unbind('keyup').keyup(function (e)
	{
		e.stopPropagation();

		if (e.keyCode == 13)
		{
			searchSelectMemberList();

			return false;
		}
	});

	$('.selectMemberBtn').unbind('click').bind('click',function(){

		searchSelectMemberList();

		return false;
	})

	function searchSelectMemberList()
	{
		var keyword = $('input[name="selectMemberKeyword"]').val();

		$.ajax({
			url:"<?php echo U('AjaxRequest/getMemberList');?>",
			type:'get',
			data:{'sMemberKeyword':keyword},
			async: false,
			datatype:'json',
			success:function(data)
			{

				$('#member-detail').html(data.html);

				$('#Memberlist .feeldesk-page').html(data.page);

				layui.use('form', function() {

					var form = layui.form; //只有执行了这一步，部分表单元素才会自动修饰成功

					form.render();

				});

				$('#Memberlist .feeldesk-page a').click(function()
				{
					pageclick(this);

					return false;
				})

			},
			error:function()
			{
				layer.msg("<?php echo L('FAILED_TO_ACQUIRE_USER');?>");
			}
		});
	}

</script><?php endif; ?>

		<?php if(!empty($istoPoolCustomerAuth)): ?><div class="hidden hg100 div-layerframe feeldesk-form layui-form" id="abandonCust">

	<div class="feeldesk-form pd0 feelcrm-form">

		<div class="layui-tab">

			<ul class="layui-tab-title">

				<li class="tab-title-name"><?php echo L('CHOOSE_GIVE_UP_REASON');?></li>

				<li class="tab-title-btn">

					<?php if((CONTROLLER_NAME) == "Customer"): if(!empty($customer["customer_id"])): ?><a href="javascript:abandonOperate('<?php echo U('customer/toPool');?>','<?php echo L('GIVE_UP');?>','<?php echo encrypt($customer['customer_id'],'CUSTOMER');?>')" class="layui-btn layui-btn-normal titleSubmit"><?php echo l('SUBMIT');?></a>

							<?php else: ?>

							<a href="javascript:abandonOperate('<?php echo U('customer/toPool');?>','<?php echo L('GIVE_UP');?>')" class="layui-btn layui-btn-normal titleSubmit"><?php echo l('SUBMIT');?></a><?php endif; ?>

					<?php else: ?>

						<?php if(!empty($clue["clue_id"])): ?><a href="javascript:abandonOperate('<?php echo U('clue/toPool');?>','<?php echo L('GIVE_UP');?>','<?php echo encrypt($clue['clue_id'],'CLUE');?>')" class="layui-btn layui-btn-normal titleSubmit"><?php echo l('SUBMIT');?></a>

							<?php else: ?>

							<a href="javascript:abandonOperate('<?php echo U('clue/toPool');?>','<?php echo L('GIVE_UP');?>')" class="layui-btn layui-btn-normal titleSubmit"><?php echo l('SUBMIT');?></a><?php endif; endif; ?>

					<a href="javascript:closeLayerAll();" class="layui-btn layui-btn-normal titleCancel"><?php echo l('CANCEL');?></a>

					<div class="clear"></div>

				</li>

			</ul>

		</div>

	</div>

	<div class="form-content">

		<div class="form-item pb25 pt50 create-both-end">

			<div class="layui-form-item">

				<label class="layui-form-label">

				   <?php echo L('REASON_FOR_GIVING_UP');?>

				</label>

				<div class="layui-input-inline">

					<select name="abandon_id" id="abandon_id" lay-ignore >

						<option value=""><?php echo L('CHOOSE_GIVE_UP_REASON');?></option>

						<?php if(is_array($abandons)): $i = 0; $__LIST__ = $abandons;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><option value="<?php echo ($v["abandon_id"]); ?>" title="<?php echo ($v["abandon_name"]); ?>"><?php echo ($v["abandon_name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>

					</select>

					<script>

						$("#abandon_id").select2();

					</script>

				</div>

				<i class="layui-icon layui-icon-about intro-icon" data-note="<?php echo L('ENTER_NAME_SEARCH');?>"></i>

			</div>

			<div class="layui-form-item layui-form-item-remark">

				<label class="layui-form-label"><?php echo L('REMARKS');?>：</label>

				<div class="layui-input-inline" style="line-height: 32px">

					<?php if((CONTROLLER_NAME) == "Customer"): echo L('GIVE_UP_REMARK',['name'=>L('CUSTOMER')]);?>

					<?php else: ?>

						<?php echo L('GIVE_UP_REMARK',['name'=>L('CLUE')]); endif; ?>

				</div>

			</div>

		</div>

	</div>

</div><?php endif; ?>


		<script>

			$(function(){

				$('#Memberlist .feeldesk-page a').click(function(){

					pageclick(this,'/Customer/index');

					return false;
				})

			})

		</script>

		<script type="text/javascript">

			layui.use('upload', function()
			{
				var upload = layui.upload;

				upload.render(
				{
					elem:'#uploadFile',

					url: "<?php echo U('Upload/importExcel',['source'=>'customer']);?>",

					field:'excel',

					exts: 'xlsx|xls',

					accept:'file',

					before:function()
					{
						layer.msg("<?php echo L('IMPORT_LOADING');?>",{time:1000000,shift:0,offset:['100px']})
					},
					done: function(res)
					{
						if(res.error == 1)
						{
							layer.msg(res.msg,{icon:1,time:1000,shift:0,offset:['60px']},function()
							{
								window.location.href = res.url;
							});
						}
						else
						{
							layer.msg(res.msg,{icon:2,time:2000,offset:['60px']});
						}
					}
				})
			});

			layui.use('form',function()
			{
				var form = layui.form;

				form.render('checkbox');

				form.render('radio');

				form.render('select');

			})

		</script>

    </div>

	<div class="export-content hidden" id="export-content">

	<form action="" method="get" id="exportForm">

		<ul>

			<?php if(is_array($export_list)): $i = 0; $__LIST__ = $export_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li>

					<a href="javascript:"><?php echo ($v["name"]); ?></a>

					<input type="checkbox" name="exportList[]" value="<?php echo ($v["define"]); ?>" class="hidden" />

				</li><?php endforeach; endif; else: echo "" ;endif; ?>


			<div class="clear"></div>

			<li class="export-type">

				<a href="javascript:" class="select-this"><?php echo L('EXPORT_THIS_PAGE');?></a>

				<input type="radio" name="exporttype" value="thisdata" checked class="hidden" />

			</li>

			<li class="export-type">

				<a href="javascript:"><?php echo L('EXPORT_ALL');?></a>

				<input type="radio" name="exporttype" value="alldata" class="hidden" />

			</li>

			<li class="export-type">

				<a href="javascript:"><?php echo L('PAGINATED_EXPORT');?></a>

				<input type="radio" name="exporttype" value="pagedata" class="hidden" />

			</li>

			<span>

				<input type="number" name="startpage" class="export-page-input" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" value="" /> <?php echo L('PAGE');?> --

				<input type="number" name="endpage" class="export-page-input" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" value="" /> <?php echo L('PAGE');?>

				<input type="hidden" name="nowpage" value="<?php echo ($nowPage); ?>"  />

			</span>

			<div class="clear"></div>

			<div class="export_explain"><span>*</span> <?php echo L('EXPORT_REMARK');?></div>

		</ul>

	   <div class="export-content-footer mb20"><a href="javascript:" class="feelcrm-commbtn" id="toExport"><?php echo L('START_EXPORT');?></a></div>

	</form>

</div>


	<script>

		var export_url = "/Customer/export";

		var export_action = "<?php echo (ACTION_NAME); ?>";

	</script>



    </div>

    </body>

</html>